<?php

class		Comment extends ObjectModel {

  const TYPE_FINGER_UP = 1;
  const TYPE_FINGER_DOWN = -1;
  const TYPE_COMMENT_ONLY = 0;

  public 		$id;

  /** @var integer Id of finger */
  public 		$id_finger;

  /** @var integer Id of user */
  public 		$id_user;

  /** @var string Comment itself */
  public 		$comment;

  /** @var integer Type of comment */
  public 		$type;

  /** @var integer Creation timestamp */
  public 		$timestamp;

  protected	$fieldsRequired = array();
  protected	$fieldsSize = array();
  protected	$fieldsValidate = array();

  protected	$table = 'comments';
  protected 	$identifier = 'id';

  public function getFields() {
    parent::validateFields();
    $fields['id_finger'] = intval($this->id_finger);
    $fields['id_user'] = intval($this->id_user);
    $fields['comment'] = pSQL($this->comment);
    $fields['type'] = $this->type;
    $fields['timestamp'] = intval($this->timestamp);
    return $fields;
  }
}

?>